package com.nobody.facepk.dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.nobody.facepk.model.Friends;
import com.trg.dao.hibernate.GeneralDAO;
import com.trg.search.Search;

@Component
public class FriendsDao {
	private GeneralDAO generalDao;
	
	public Friends getFriendsByUserid(long userId) {
		Search search = new Search(Friends.class);
		search.addFilterEqual("userId", userId);
		Friends friends = (Friends)this.generalDao.searchUnique(search);
		return friends;
	}
	
	@Autowired
	public void setGeneralDao(GeneralDAO generalDao) {
		this.generalDao = generalDao;
	}
}
